package pkg.drowne.org;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;

public class NewGameMenu extends Activity implements OnClickListener {
	
	ImageButton creategameButton, joingameButton;	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(
        WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.newgamemenu);
        
        registerViews();
        setupOnClickListeners();        
        
    }

    private void registerViews() {
		
    	joingameButton 	= (ImageButton)this.findViewById(R.id.join_game_button);
    	creategameButton 	= (ImageButton)this.findViewById(R.id.create_game_button);
    	
	}

	public void setupOnClickListeners() {
        
		joingameButton.setOnClickListener(this);
		creategameButton.setOnClickListener(this);
    }
    
    public void onClick(View V) {
    	
    	switch(V.getId()) {
    	
    	case R.id.create_game_button:
    		Intent creategameIntent = new Intent(this, CreateGame.class);
    		startActivity(creategameIntent);
    		break;
    	
    	case R.id.join_game_button:
    		Intent joingameIntent = new Intent(this, JoinGame.class);
    		startActivity(joingameIntent);
    		break;

    	}

    }
    
}